package virtual.repo;

import android.content.Context;


import com.lody.virtual.remote.InstallResult;

import org.jdeferred.Promise;

import java.io.File;
import java.util.List;

import virtual.models.AppData;
import virtual.models.AppInfo;
import virtual.models.AppInfoLite;


/**
 * @author gaoxin 2019-07-13 17:58
 * @version V1.0.0
 * @name AppDataSource
 * @mail godfeer@aliyun.com
 * @description  虚拟空间所有应用程序 、安装的所有应用程序。
 */
public interface AppDataSource {

    /**
     * @return All the Applications we Virtual.
     */
    Promise<List<AppData>, Throwable, Void> getVirtualApps();

    /**
     * @param context Context
     * @return All the Applications we Installed.
     */
    Promise<List<AppInfo>, Throwable, Void> getInstalledApps(Context context);

    Promise<List<AppInfo>, Throwable, Void> getStorageApps(Context context, File rootDir);

    InstallResult addVirtualApp(AppInfoLite info);

    boolean removeVirtualApp(String packageName, int userId);
}
